package com.miexiaoliang.springbootshiro;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

public class BaseController {

    Subject getSubject() {
        return SecurityUtils.getSubject();
    }

    int getcurrentUserId() {
        User user = (User) getSubject().getPrincipal();
        return user.getId();
    }

}